import axios  from "@/utils/http.js"
import * as buildingURL from "@/api/url.js"

//封装获取楼宇列表的函数
export const getBuildingList=(params)=>{
    return axios({
        method:"get",
        url:buildingURL.buildingListURL,
        params,
    })
}
export const deleteBuildingList=(data)=>{
    return axios({
        method:"post",
        url:buildingURL.deleteBuilding,
        data,
        //配置参数 直接就是ket=value 不需要转json了 转为普通表单形式
        headers:{
            "Content-Type":"application/x-www-form-urlencoded",
        }
    })
}
//添加楼宇的函数
export const addBuilding=(data)=>{
    return axios({
        method:"get",
        url:buildingURL.addBuildingURL,
       data,
    })
}

export const updateBuilding=(data)=>{
    return axios({
        method:"get",
        url:buildingURL.updateBuilding,
        data,
    })
}
